local jinmie = fk.CreateSkill {
  name = "jinmie",
}

jinmie:addEffect("active", {
  anim_type = "offensive",
  card_num = 0,
  target_num = 1,
  prompt = "#jinmie",
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter =function (self, player, to_select, selected, selected_cards, card, extra_data)
    return #selected == 0 and to_select:getHandcardNum() > player:getHandcardNum() and not player:isProhibited(to_select, Fk:cloneCard("fire__slash"))
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local use = {
      from = player,
      tos = {target},
      card = Fk:cloneCard("fire__slash"),
      extraUse = true,
    }
    use.card.skillName = self.name
    room:useCard(use)
    if not player.dead and not target.dead and use.damageDealt and use.damageDealt[target] then
      local n = target:getHandcardNum() - player:getHandcardNum()
      if n <= 0 then return end
      room:doIndicate(player.id, {target.id})
      local cards = room:askForCardsChosen(player, target, n, n, "h", self.name)
      room:throwCard(cards, self.name, target, player)
    end
  end,
})

return jinmie